package com.xkdx.guangguang.presistence.getgoods;

import org.json.JSONArray;
import org.json.JSONObject;

import com.xkdx.guangguang.module.network.AbsModule;

public class GetGoodsModule extends AbsModule {
	public boolean isGetSuccess=false;
	public  String message="";
	@Override
	public void parseData() throws Exception {
		backJson = (JSONArray) result;
		try {
			for (int i = 0; i < backJson.length(); i++) {
				jsonObj = (JSONObject) backJson.get(i);
				String sortOfAct = jsonObj.getString("Act");
				if (sortOfAct.equals("payListItemCheck")) {
					isGetSuccess=parseGetGoods(jsonObj.getJSONObject("DetailInfo"));
				}

			}
		} catch (Exception e) {
			throw e;
		}

	}
//	[{"Act":"payListItemCheck","DetailInfo":{"StatusCode":1,"DetailInfo":"","Message":"操作成功!"},"Mod":"payChapterAction"}]
	
	private boolean parseGetGoods(JSONObject person) throws Exception{
		// TODO Auto-generated method stub
		try {
			String Status = person.getString("StatusCode");
			message=person.getString("Message");
			if (Status.equals("1")) {
				return true;
			}
		} catch (Exception e) {
			throw e;
		}
		return false;
	}
}
